package org.example.sms;

import java.time.LocalDate;

public class Demo03 {
    public static void main(String[] args) {
        StudentManagementSystem03 sms = new StudentManagementSystem03();
        //1.添加学生
        sms.addStudent(new PrimaryStudent(20241316,"小新",77,81
                , LocalDate.parse("2013-10-12"),"233434@qq.com"));
        sms.addStudent(new PrimaryStudent(20241327,"小明",95,88
                , LocalDate.parse("2014-11-12"),"233534@qq.com"));
        sms.addStudent(new PrimaryStudent(20241333,"花花",90,63
                , LocalDate.parse("2023-10-15"),"233434234344"));
        sms.addStudent(new PrimaryStudent(20241335,"天天",71,83
                , LocalDate.parse("2024-12-12"),"123123323@qq.com"));

        //2.展示学生
        System.out.println("=========展示所有学生=========");
        sms.showAllStudents();

        //3.更新学生
        System.out.println("=========根据序号更新学生=========");
        Student oldStudent = sms.updateStudentByIndex(2, new PrimaryStudent(20241338, "小明明", 97, 88
                , LocalDate.parse("2014-11-12"), "233534@qq.com"));
        System.out.println(oldStudent);

        System.out.println("=========展示所有学生=========");
        sms.showAllStudents();

        //4.随机点名
        System.out.println("=========随机点名=========");
        System.out.println(sms.randomRollCall());
    }
}

